# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-bintrees
_pkgname=bintrees
pkgver=2.2.0
pkgrel=6
pkgdesc='Package provides Binary-, RedBlack- and AVL-Trees.'
url='https://github.com/mozman/bintrees'
arch=('x86_64' 'aarch64')
license=('custom')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-wheel'
             'python-setuptools' 'cython0')
source=("https://github.com/mozman/bintrees/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('640b9979ff9ef25fedbc59c9203363039e732b1ecbeda6475126c7c872207e9b790b7c6c8e67457c029f0d5397c28e6767c1c49061693135206eece98bb203bf')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build_ext -i
  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkgname-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE.txt -t "$pkgdir/usr/share/licenses/$pkgname"
}

